all: stage0.bin
	make -C payload/loader
	make -C payload/sbx

stage0.bin: payload/stage0.asm
	nasm -o $@ $<

clean:
	rm -f stage0.bin payload.js
	make clean -C payload/loader
	make clean -C payload/sbx

install:
	mkdir -p ../../../../data/exploits/CVE-2020-9850/
	cp stage0.bin ../../../../data/exploits/CVE-2020-9850/stage0.bin
	cp payload/loader/loader.bin ../../../../data/exploits/CVE-2020-9850/loader.bin
	cp payload/sbx/sbx ../../../../data/exploits/CVE-2020-9850/sbx.bin
	echo "Installed!"

.PHONY: all clean
